using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LigerMVC.Entities.Mapping
{
    public class Sys_MenuMap : EntityTypeConfiguration<Sys_Menu>
    {
        public Sys_MenuMap()
        {
            // Primary Key
            this.HasKey(t => t.MenuID);

            // Properties
            this.Property(t => t.Guid)
                .HasMaxLength(50);

            this.Property(t => t.MenuNo)
                .HasMaxLength(50);

            this.Property(t => t.MenuParentNo)
                .HasMaxLength(50);

            this.Property(t => t.MenuName)
                .HasMaxLength(100);

            this.Property(t => t.MenuNameStringCode)
                .HasMaxLength(100);

            this.Property(t => t.Remark)
                .HasMaxLength(4000);

            this.Property(t => t.MenuUrl)
                .HasMaxLength(100);

            this.Property(t => t.MenuScript)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("Sys_Menu");
            this.Property(t => t.MenuID).HasColumnName("MenuID");
            this.Property(t => t.Guid).HasColumnName("Guid");
            this.Property(t => t.MenuNo).HasColumnName("MenuNo");
            this.Property(t => t.MenuParentNo).HasColumnName("MenuParentNo");
            this.Property(t => t.MenuName).HasColumnName("MenuName");
            this.Property(t => t.MenuNameStringCode).HasColumnName("MenuNameStringCode");
            this.Property(t => t.Remark).HasColumnName("Remark");
            this.Property(t => t.MenuUrl).HasColumnName("MenuUrl");
            this.Property(t => t.MenuScript).HasColumnName("MenuScript");
            this.Property(t => t.MenuIsLeaf).HasColumnName("MenuIsLeaf");
            this.Property(t => t.SeqNo).HasColumnName("SeqNo");
        }
    }
}
